package com.itheima.job2;

import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;

public class Test {
    public static void main(String[] args) {
        FileInputStream fis=null;
        try {
           fis = new FileInputStream("E:/test/text.txt");
            byte[] buffer = new byte[3];
            int count = 0 ;
            int charN ;
            while((charN=fis.read(buffer))!=-1) {
                if (new String(buffer,0,charN).equals("黄")){
                    count++;
                }
            }
            System.out.println(count);

        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            try {
                fis.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
